{include file="public/header" /}
<style type="text/css">
	.float-e-margins .btn{margin: 0!important;}
	.laydate-icon{background-image: none!important;}
	.choose_time{width: 80px;}
	td i{font-style: normal;}
	td img{cursor:pointer;width: 8rem;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>第三方服务列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
            <div class="row">
	                <form name="order" class="form-search form-inline" method="post" action="{:url('')}">
	                	<div  class="col-sm-1">
		                    <div class="input-group" >  
		                        <a href="{:url('edit_serve')}"><button class="btn btn-outline btn-primary" type="button">添加服务</button></a> 
		                    </div>
		                </div>
		                <div class="col-sm-3">
                        	<div class="input-group">
				        		<span class="input-group-btn"><i class="btn btn-primary" style="font-style: normal;">服务分类</i></span>
				        			<select class="form-control m-b" name="type">
				        				<option value="">全部分类</option>
				        				{volist name="cates" id="cate" key="i"}
				        					<option value="{$i}">{$cate}</option>
				        				{/volist}
	                               </select>
							</div>
						</div>
						<div class="col-sm-2">
							<div class="form-group">
						        <input class="form-control" type="text" name="phone" value="{if !empty($phone)}{$phone}{/if}"  placeholder="手机号模糊查询">
							</div>
						</div>
						<div class="col-sm-2">
							<div class="form-group">
						        <input class="form-control" type="text" name="company_name" value="{if !empty($company_name)}{$company_name}{/if}"  placeholder="名称模糊查询">
							</div>
						</div>
						<div class="col-md-1">
							<div class="form-group">
								<button class="btn btn-outline btn-primary" type="submit">
									<i class="fa fa-search"></i>搜索
								</button>
							</div>
						</div>
					  	<div class="col-md-1">
					  		<div class="form-group">
								<button class="btn btn-outline btn-primary" type="button"  onClick="export_excel();">导出数据</button>
							</div>
					  	</div>
	              </form>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                            	<th>服务类别</th>
                            	<th>公司名称</th>
                            	<th>联系人</th>
                            	<th>头像</th>
                            	<th>简介</th>
                            	<th>手机号码</th>
                            	<th>费用</th>
                            	<th>状态</th>
                            	<th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                    		{volist name="data" id="item" empty="$empty"}
                        	<tr class="long-td">
                        		<td>{$cates[$item.type-1]}</td>
                        		<td>{$item.company_name}</td>
                        		<td>{$item.name}</td>
                        		<td><img style="width:65px;height:55px" class="img-thumbnail" onerror="this.src='/static/admin/images/head_default.gif'" src="/uploads/images/{$item.head_img}"/></td>
                        		<td>{$item.decl}</td>
                        		<td>{$item.phone}</td>
                        		<td>{$item.price}</td>
                        		<td>{:change_stat($item.id,$item.stat,'stat')}</td>
                        		<td>
                        			<a href="javascript:;" onclick="edit({$item.id})" class="btn btn-primary btn-outline btn-xs">
                                        <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="del({$item.id})" class="btn btn-danger btn-outline btn-xs">
                                        <i class="fa fa-trash-o"></i> 删除</a>
                        		</td>
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">{$page}</div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>
{include file="public/footer" /}

<script type="text/javascript">
	cate_id="{$type}";
   	$('img').on('click',function(){
   		var path=$(this).attr('src');
   		layer.open({
			type:1,
			title:false,
			shadeClose:true,
			closeBtn:0,
			content:"<img class='img-thumbnail' src='"+path+"'>"
		});
   	});
 	//导出数据
   	function export_excel(){
   		layer.msg('稍后再来吧！');
// 		window.location.href="{:url('Export/export_use_tag')}?status="+status+"&co_id="+co_id+"&stime="+stime+"&etime="+etime
   	}
   	$('select[name="type"] option').each(function(){
   		if($(this).val()==cate_id) $(this).attr('selected','selected');
   	});
//展示程序数据
//function showprogram(nid){
//  location.href = './showprogram/nid/'+nid+'.html';
//}
//查看商品在移动端展示
//function see(id){
//	layer.open({
//		type:2,
//		title:false,
//		closeBtn:false,
//		shadeClose:true,
//		area: ['400px', '660px'],
//		content:"{:url('show_goods')}?id="+id
//	});
//}
//查看点评
//function remark(id,goods_name){
//	location.href = "{:url('remark')}?goods_id="+id+"&goods_name="+goods_name;
//}
//编辑程序
function edit(id){
    location.href = "{:url('edit_serve')}?id="+id;
}
//
//更改是否显示
function change_stat(_this,id,key){
    lunhui.change_stat(_this,'serve','id',id,key,'{:url("index/change_stat")}');
}
//删除
function del(id){
    lunhui.del('serve','id',id,'{:url("index/del")}');
}
</script>
</body>
</html>